#include "StdAfx.h"
#include "RoundRectangle.h"

CRoundRectangle::CRoundRectangle(void)
{
}

CRoundRectangle::CRoundRectangle(UINT type,CPoint pt)
{
	m_DrawType=type;
	m_Selected = 0;
	Point=pt;
	PrePoint=pt;
	Height=80;
	Width=120;
	m_point[1].x = pt.x - Width/2;
	m_point[1].y = pt.y - Height/2;
	m_point[2].x = pt.x;
	m_point[2].y = pt.y - Height/2;
	m_point[3].x = pt.x + Width/2;
	m_point[3].y = pt.y - Height/2;
	m_point[4].x = pt.x + Width/2;
	m_point[4].y = pt.y;
	m_point[5].x = pt.x + Width/2;
	m_point[5].y = pt.y + Height/2;
	m_point[6].x = pt.x;
	m_point[6].y = pt.y + Height/2;
	m_point[7].x = pt.x - Width/2;
	m_point[7].y = pt.y + Height/2;
	m_point[8].x = pt.x - Width/2;
	m_point[8].y = pt.y;
}

void CRoundRectangle::Draw(CDC *pDC)
{
	pDC->RoundRect(m_point[1].x,m_point[1].y,m_point[5].x,m_point[5].y,30,30);
	if(m_Selected>=1)
		ShowTracker(pDC);
}

void CRoundRectangle::SetWH()
{
	Width = m_point[3].x - m_point[1].x;
	Height = m_point[7].y - m_point[1].y;
}
CRoundRectangle::~CRoundRectangle(void)
{
}
